package unit1_1009.test4;
/*
 * 设计一个计算器类Calculator。
 * 让该类具有加、减、乘、除、取模、幂运算的功能；只要传入任意两个数，均可以计算并返回对应的算术运算结果。
 */
public class Calculator {
	
	public double add(double a,double b) {
		return a+b;
	}
	
	public double subtract(double a,double b) {
		return a-b;
	}
	
	public double mutiply(double a,double b) {
		return a*b;
	}
	
	public double divide(double a,double b) {
		if(b==0) {
			return 0;
		}else {
			return a/b;
		}
	}
	
	public int mo(double a,double b) {
		return ((int)a)%((int)b);
	}
	
	public double pow(double a,double b) {
		return Math.pow(a, b);
	}
	
}
